package com.scs.application.modules.finance.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.scs.application.core.entity.SimpleDataEntity;
import com.scs.application.modules.upgrade.db.annotation.EntityClassAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityFieldAnnotation;
import com.scs.application.modules.upgrade.db.annotation.EntityIndexAnnotation;
import com.scs.application.modules.upgrade.db.enums.EntityFieldType;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Date;
/**
 * <p>
 *
 * </p>
 */
@Data
@Accessors(chain = true)
@TableName("finance_bill_item")
@EntityIndexAnnotation(ix = {"bill_id","matr_id","sn","rfid",
        "status","settlement_id","hrp_key","hrp_id","ref_bus_id","ref_bus_type",
        "ref_bus_item_id","ref_bus_table"}
        )
@EntityClassAnnotation(remark = "记账明细表")
public class BillItem extends SimpleDataEntity {


    // id ,在父类中处理

    @EntityFieldAnnotation(
            text = "外键",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String billId;

    @EntityFieldAnnotation(
            text = "耗材ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrId;

    @EntityFieldAnnotation(
            text = "品名",
            length = "255",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrName;

    @EntityFieldAnnotation(
            text = "品规",
            length = "255",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String matrSpec;

    @EntityFieldAnnotation(
            text = "单品价格",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuPrice;

    @EntityFieldAnnotation(
            text = "单品单位",
            length = "10",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String skuUnit;

    @EntityFieldAnnotation(
            text = "单品数量",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double skuQty;

    @EntityFieldAnnotation(
            text = "金额",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Double amount;

    @EntityFieldAnnotation(
            text = "批次",
            length = "30",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String lot;

    @EntityFieldAnnotation(
            text = "效期",
            type = EntityFieldType.DATE,
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date expDate;

    @EntityFieldAnnotation(
            text = "生产日期",
            type = EntityFieldType.DATE,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private Date mfgDate;

    @EntityFieldAnnotation(
            text = "",
            length = "30",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String sn;

    @EntityFieldAnnotation(
            text = "",
            length = "30",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String rfid;

    @EntityFieldAnnotation(
            text = "",
            length = "50",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String udi;


    @EntityFieldAnnotation(
            text = "厂商名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String manufactureName;

    @EntityFieldAnnotation(
            text = "结算单Id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private String settlementId;

    @EntityFieldAnnotation(
            text = "注册证号",
            length = "50",
            not_null = false,
            default_value = "",
            comment = "注册证号"
    )
    private String certificateNo;

    @EntityFieldAnnotation(
            text = "状态",
            length = "",
            not_null = false,
            default_value = "0",
            comment = "0：空；1：已结算；2：已推送；3：已开票"
    )
    private Integer status;

    @EntityFieldAnnotation(
            text = "hrp单号",
            length = "50",
            not_null = false,
            default_value = "",
            comment = "hrp单号"
    )
    private String hrpKey;

    @EntityFieldAnnotation(
            text = "hrp主键",
            length = "50",
            not_null = false,
            default_value = "",
            comment = "hrp主键"
    )
    private String hrpId;

    @EntityFieldAnnotation(
            text = "计费数量",
            length = "",
            not_null = false,
            default_value = "0",
            comment = ""
    )
    private Double skuQtyCharge;


    @EntityFieldAnnotation(
            text = "原始业务数据id",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String refBusId;

    @EntityFieldAnnotation(
            text = "原始业务类型",
            length = "",
            not_null = true,
            default_value = "",
            comment = "WorkOrder.busType"
    )
    private String refBusType;

    @EntityFieldAnnotation(
            text = "原始业务类型",
            length = "",
            not_null = true,
            default_value = "",
            comment = "WorkOrder.busType"
    )
    private String refBusTypeName;

    @EntityFieldAnnotation(
            text = "原始业务表名称",
            length = "",
            not_null = true,
            default_value = "",
            comment = "小写"
    )
    private String refBusTable;


    @EntityFieldAnnotation(
            text = "原始业务单号",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String refBusKey;

    @EntityFieldAnnotation(
            text = "原始业务日期",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private Date refBusDate;


    @EntityFieldAnnotation(
            text = "原始业务明细数据id",
            length = "",
            not_null = true,
            default_value = "",
            comment = ""
    )
    private String refBusItemId;

    @EntityFieldAnnotation(
            text = "原始业务明细表名称",
            length = "",
            not_null = true,
            default_value = "",
            comment = "小写"
    )
    private String refBusItemTable;

    @EntityFieldAnnotation(
            text = "HIS编码",
            length = "30",
            not_null = false,
            default_value = "",
            comment = "HIS编码"
    )
    private String hisCode;

    @EntityFieldAnnotation(
            text = "his价格",
            not_null = false,
            default_value = "",
            comment = "his价格"
    )
    private Double hisPrice;

    /**
     * 阳采代码
     **/
    @EntityFieldAnnotation(
            text = "阳采耗材代码",
            length = "255",
            not_null = false,
            default_value = "",
            comment = "阳采耗材代码"
    )
    private String sunPurchaseCode;

    /**
     * 阳采代码规格Id
     **/
    @EntityFieldAnnotation(
            text = "阳采代码规格Id",
            length = "255",
            not_null = false,
            default_value = "",
            comment = "阳采代码规格Id"
    )
    private String sunPurchaseSpecId;

    /**
     * hrp仓库code
     **/
    @EntityFieldAnnotation(
            text = "hrp仓库code",
            length = "20",
            not_null = false,
            default_value = "",
            comment = "hrp仓库code"
    )
    private String hrpWarehouseCode;

    /**
     * hrp仓库名称
     **/
    @EntityFieldAnnotation(
            text = "hrp仓库名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "hrp仓库名称"
    )
    private String hrpWarehouseName;

    @EntityFieldAnnotation(
            text = "耗材型号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "耗材型号"
    )
    private String matrModel;

    @EntityFieldAnnotation(
            text = "试剂组id",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = ""
    )
    private String reagentTeamId;

    @EntityFieldAnnotation(
            text = "是否冲红",
            length = "",
            not_null = true,
            comment = "1：冲红，0：非冲红"
    )
    private Boolean flagRed;

    @EntityFieldAnnotation(
            text = "是否期初",
            length = "",
            not_null = true,
            comment = "1：期初，0：非期初"
    )
    private Boolean flagInit;

    @EntityFieldAnnotation(
            text = "住院号",
            length = "50",
            default_value = "",
            comment = "患者住院唯一标识"
    )
    private String inpatientNo;

    @EntityFieldAnnotation(
            text = "门诊号",
            length = "50",
            default_value = "",
            comment = "患者门诊唯一标识"
    )
    private String outpatientNo;

    @EntityFieldAnnotation(
            text = "hrp耗材编码",
            length = "30",
            not_null = false,
            default_value = "",
            comment = "hrp耗材编码"
    )
    private String hrpCode;

    @EntityFieldAnnotation(
            text = "手术id",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String oprtId;

    @EntityFieldAnnotation(
            text = "手术名称",
            length = "200",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String oprtName;

    @EntityFieldAnnotation(
            text = "手术单号",
            length = "100",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String oprtCode;

    @EntityFieldAnnotation(
            text = "病人id",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String patientId;

    @EntityFieldAnnotation(
            text = "病人名称",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String patientName;

    @EntityFieldAnnotation(
            text = "病人编号",
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String patientNo;

    @EntityFieldAnnotation(
            text = "厂商ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = "厂商ID"
    )
    private String mfgId;

    @EntityFieldAnnotation(
            text = "厂商名称",
            length = "100",
            not_null = false,
            default_value = "",
            comment = "厂商名称"
    )
    private String mfgName;

    @EntityFieldAnnotation(
            text = "原始入库单明细ID",
            type = EntityFieldType.LONG,
            length = "",
            not_null = false,
            default_value = "",
            comment = ""
    )
    private String lineId;


    @EntityFieldAnnotation(
            text = "病人类型",
            length = "",
            not_null = false,
            default_value = "",
            comment = "0:住院病人；1:门诊病人"
    )
    private String patientType;

    //门诊号或者住院号，打印显示使用
    @TableField(exist = false)
    private String inoutpatientNo;

}
